#pragma once

#include "mutex.h"

namespace sukai {
namespace thread {

class AutoLock
{
public:
    AutoLock(Mutex* mutex);
    AutoLock(Mutex* mutex,std::string type);
    int lock();
    int try_lock();
    int unlock();
    ~AutoLock();

private:
    Mutex* m_mutex;
};

}}
